<?php
namespace app\index\controller;
use think\Db;

class Tags extends Base{

    public function index(){

        $tags = input('tags');
        $map['a.keywords'] = ['like', "%{$tags}%"];
        $arters = Db::name('article')
                        -> alias('a')
                        -> join('cate c', 'c.id = a.cate_id', 'LEFT')
                        -> field('a.*, c.catename')
                        -> order('a.id DESC')
                        -> where($map)
                        -> paginate(2);


        $this -> assign('arters', $arters);
        return $this -> fetch('lst');
    }
}